import { $request } from "../../utils/request"

// 向服务器请求关注列表
export const getAttentions = ((id) => {
    return new Promise ((resolve, reject) => {
        $request({
            url:'attentions?id=' + id,
            method:'GET',
        }).then((res) => {
            resolve(res)
        }).catch((err) => {
            reject(err)
        })
    })
})

// 取消关注
export const getDelFollow = ((id) => {
    return new Promise ((resolve, reject) => {
        $request({
            url:'follow',
            method:'DELETE',
            data:{
                follower:id
            }
        }).then((response) => {
            console.log("关注成功", response);
            resolve(response.data)
        }).catch((error) => {
            console.log("关注失败", error);
            reject(error)
        })
    })
})